package org.yzh.rbac.model.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.yzh.rbac.model.entity.RoleDO;

import java.util.List;

public class User {
    private Integer id;

    private String username;

    private List<RoleDO> roleList;

    private List<Permis> permisTree;

    @JsonProperty("access_token")
    private String accessToken;

    public User() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public List<RoleDO> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<RoleDO> roleList) {
        this.roleList = roleList;
    }

    public List<Permis> getPermisTree() {
        return permisTree;
    }

    public void setPermisTree(List<Permis> permisTree) {
        this.permisTree = permisTree;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        return result;
    }
}